using UnityEngine;
using QFramework;
using Unity.VisualScripting;

namespace Projectsurviva
{
    public partial class FxContoller : ViewController
    {
        private static FxContoller mdefault;
        private void Awake()
        {
            mdefault = this;
        }
        private void OnDestroy()
        {
            mdefault = null;

        }
        public static void Play(SpriteRenderer sprite,Color dissolveColor)
        {
            mdefault.EnemyDieFx.Instantiate().Position(sprite.Position()).LocalScale(sprite.Scale()).Self(s => 
            {
                s.GetComponent<Dissolve>().DissolveColor = dissolveColor;
                s.sprite = sprite.sprite;
            
            } ).Show();
        }

    }
}
